public class Grobanalyse {

	

	public static int findCharLeft(String str, char ch) {
		for (int i = 0; i < str.length() - 1; i++) {
			if (str.charAt(i) == ch) {
				return i;
			}
		}
		return -1;
	}

	public static int findCharRight(String str, char ch) {
		for (int i = str.length() - 1; i > 0; i--) {
			if (str.charAt(i) == ch) {
				return i;
			}
		}
		return -1;
	}

	public static int findCharRandom(String str, char ch) {
		boolean notFound = true;
		

		while (notFound) {
			int random = (int) (Math.random() * str.length());
			if (str.charAt(random) == ch) {
				notFound = false;
				return random;
			}
			
		}
		return -1;

	}

	// @Override
	// public String toString() {
	//
	// return
	// }
}
